var o, e = require, t = module, n = exports, i = this && this.__extends || (o = function(e, t) {
    return (o = Object.setPrototypeOf || {
        __proto__: []
    } instanceof Array && function(e, t) {
        e.__proto__ = t;
    } || function(e, t) {
        for (var r in t) t.hasOwnProperty(r) && (e[r] = t[r]);
    })(e, t);
}, function(e, t) {
    function r() {
        this.constructor = e;
    }
    o(e, t), e.prototype = null === t ? Object.create(t) : (r.prototype = t.prototype, 
    new r());
}), a = this && this.__decorate || function(e, t, r, o) {
    var n, i = arguments.length, c = i < 3 ? t : null === o ? o = Object.getOwnPropertyDescriptor(t, r) : o;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) c = Reflect.decorate(e, t, r, o); else for (var a = e.length - 1; 0 <= a; a--) (n = e[a]) && (c = (i < 3 ? n(c) : 3 < i ? n(t, r, c) : n(t, r)) || c);
    return 3 < i && c && Object.defineProperty(t, r, c), c;
};

Object.defineProperty(n, "__esModule", {
    value: !0
});

var r = e("LoadManager"), s = e("Global"), c = cc._decorator, l = c.ccclass, d = c.property, u = function(t) {
    function e() {
        var e = null !== t && t.apply(this, arguments) || this;
        return e.frame = null, e.sprite = null, e.label = null, e;
    }
    return i(e, t), e.prototype.start = function() {}, e.prototype.init = function(t) {
        var e, o = this;
        t.icon && ((e = t.icon) && "" != e.trim() || isNaN(t.personIdx) ? e && r.default.getInstance().loadImage({
            url: e
        }).then(function(e) {
            o.sprite && e instanceof cc.Texture2D ? o.sprite.spriteFrame = new cc.SpriteFrame(e) : cc.log(e);
        }) : s.G.personModelList.some(function(e) {
            return e.id == t.personIdx;
        }) && r.default.getInstance().loadSpriteFrame({
            url: "image/skin/" + t.personIdx,
            sprite: this.sprite
        })), t.nickname && (e = t.nickname, this.label.string = e ? 5 < e.length ? e.substr(0, 5) + "..." : e : "匿名"), 
        t.openid && t.openid == GA.Info.openId && (this.frame.active = !0);
    }, a([ d(cc.Node) ], e.prototype, "frame", void 0), a([ d(cc.Sprite) ], e.prototype, "sprite", void 0), 
    a([ d(cc.Label) ], e.prototype, "label", void 0), a([ l ], e);
}(cc.Component);

n.default = u;